<?php


namespace App\Http\Controllers\Admin;


use App\Http\Controllers\Controller;
use App\Services\Admin\ProductService;
use Illuminate\Http\Request;

class ProductController extends Controller
{
    private $productService;

    public function __construct(Request $request, ProductService $productService)
    {
        $this->request = $request;
        $this->productService = $productService;
    }

    public function getProductInfo(Request $request)
    {
        $params = $request->post();
        $result = $this->productService->getProductInfo($params);
        return $result;
    }

    public function getGroupProductInfo(Request $request)
    {
        $params = $request->post();
        $result = $this->productService->getGroupProductInfo($params);
        return $result;
    }

    public function getProductDetail(Request $request)
    {
        $params = $request->post();
        $result = $this->productService->getProductDetail($params);
        return $result;
    }

    public function deleteProduct(Request $request)
    {
        $params = $request->post();
        $result = $this->productService->deleteProduct($params);
        return $result;
    }

    public function markProduct(Request $request)
    {
        $params = $request->post();
        $result = $this->productService->markProduct($params);
        return $result;
    }

    public function getProductLine(Request $request)
    {
        $params = $request->post();
        $result = $this->productService->getProductLine($params);
        return $result;
    }

    public function getGroupProductLine(Request $request)
    {
        $params = $request->post();
        $result = $this->productService->getGroupProductLine($params);
        return $result;
    }

    public function getProductBySjName(Request $request)
    {
        $params = $request->post();
        $result = $this->productService->getProductBySjName($params);
        return $result;
    }

    public function getProductBySjNameGroup(Request $request)
    {
        $params = $request->post();
        $result = $this->productService->getProductBySjNameGroup($params);
        return $result;
    }

    public function getDayAvgOrder(Request $request)
    {
        $params = $request->post();
        $result = $this->productService->getDayAvgOrder($params);
        return $result;
    }

    public function productLineTotalAnalyse(Request $request)
    {
        $params = $request->post();
        $result = $this->productService->productLineTotalAnalyse($params);
        return $result;
    }

    public function updateAsinOrder(Request $request)
    {
        $params = $request->post();
        $result = $this->productService->updateAsinOrder($params);
        return $result;
    }

    public function exportXls(Request $request)
    {
        $params = $request->post();
        $result = $this->productService->exportXls($params);
        return $result;
    }
}
